﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ObserverAndMediator
{
    /// <summary>
    /// 平民
    /// </summary>
    public class Commoner : EventCustomer
    {
        /// <summary>
        /// 定義平民能夠處理的事件的級別
        /// </summary>
        public Commoner() : base(EventCustomType.NEW)
        {
        }

        public override void exec(ProductEvent events)
        {
            //事件的源頭
            Product p = events.Source;
            //事件類型
            ProductEventType type = events.EventType;

            Console.WriteLine("平民處理事件：" + p.Name + " 誕生記，事件類型 = " + type);
        }
    }
}
